package team.knowers.qzh.qzhadmin.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import team.knowers.qzh.qzhadmin.config.convention.result.Result;
import team.knowers.qzh.qzhadmin.config.convention.result.Results;
import team.knowers.qzh.qzhadmin.dto.resp.AllCourseContentRespDTO;
import team.knowers.qzh.qzhadmin.service.CourseContentAdminService;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class CourseContentAdminContent {
    private final CourseContentAdminService courseContentAdminService;
    /**
     * 根据章节id展示章节内容
     */
    @GetMapping("/api/qzh-admin/admin/v1/coursecontent/show/{id}")
    public Result<List<AllCourseContentRespDTO>> shouCourseContent(@PathVariable("id") Long id)
    {
        return Results.success(courseContentAdminService.shouCourseContent(id));
    }
}
